package org.cuatrovientos.erp.business;

import java.util.List;

import org.apache.log4j.Logger;
import org.cuatrovientos.erp.dao.CurrencyDAOInterface;
import org.cuatrovientos.erp.model.Currency;
import org.springframework.beans.factory.annotation.Autowired;


public class CurrencyBO implements CurrencyBOInterface {
	
	// Get log4j logger
	private static final Logger logger = Logger.getLogger(CurrencyBO.class);
	 
	@Autowired
    private CurrencyDAOInterface currencyDAO;

	@Override
	public Currency selectById(int id) {
		logger.info("selectById: " + id);
		return currencyDAO.selectById(id);
	}

	@Override
	public List<Currency> selectAll() {
		logger.info("selectAll: ");
		return currencyDAO.selectAll();
	}

	@Override
	public List<Currency> search(String name) {
		logger.info("search : " + name);
		return currencyDAO.search(name);
	}

	@Override
	public void deleteById(int id) {
		logger.info("delete: " + id);
		 currencyDAO.deleteById(id);
	}

	@Override
	public void insert(Currency currency) {
		logger.info("insert: " + currency);
		currencyDAO.insert(currency);
	}

	@Override
	public void update(Currency currency) {
		logger.info("update: " + currency);
		currencyDAO.update(currency);
	}
}
